<script setup>
import { userteamCount } from "@/services/team";
import { ref } from "vue";

// uni.navigateBack(2)

const gohome = () => {
  // uni.navigateBack()
  let pages = getCurrentPages();

  // 获取页面栈的长度，即页面跳转层级
  let level = pages.length;
  if (level > 1) {
    uni.navigateBack();
  } else {
    uni.switchTab({
      url: "/pages/my/index",
    });
  }
};

const countobj = ref({});

const gotjfun = () => {
  uni.navigateTo({
    url: "/pages/client/Index",
  });
};
getuserteamCount();

async function getuserteamCount(params) {
  let res = await userteamCount();
  countobj.value = res.data;
}
</script>
<template>
  <view class="paycontent">
    <view class="banner-top">
      <image src="@/pages/team/static/teambanner.png" mode="widthFix" />
    </view>

    <view class="content-zt" @click="gotjfun">
      <view class="content-zt-left">
        <view class="content-titles">直接推荐（人）</view>
        <view class="content-num">{{ countobj.one_count }}</view>
      </view>
      <view class="content-zt-right">
        <u-icon name="arrow-right" color="#8C8C8C" size="16"></u-icon>
      </view>
    </view>

    <view class="content-zt content-zttwo">
      <view class="content-zt-item">
        <view class="content-num">{{ countobj.two_count }}</view>
        <view class="content-titles">间接推荐（人）</view>
      </view>
      <view class="content-zt-item">
        <view class="content-num">{{ countobj.total }}</view>
        <view class="content-titles">团队总数（人）</view>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
@import "index.scss";
</style>
